package Task;
import java.util.Objects;
import java.util.Scanner;

public class bite23 {


    public static  void main1(String[] args) {
    Scanner scanner = new Scanner(System.in);
    System.out.println("请输入物体的重量（kg）：");
    double weight = scanner.nextDouble();
    System.out.println("是否加急（y/n）：");
    String b = scanner.next();
    double cost = SuneanCost(weight,b.equalsIgnoreCase("y"));
    System.out.println("快递费用:"+cost + "元");
    scanner.close();
    }

    private static double SuneanCost(double weight, boolean y) {
        double cost;
        if (weight <= 1.0) {
            cost = 20.0;
        }
        else {
            cost = 20.0 + Math.ceil(weight - 1.0);
        }
        if (y) {
            cost += 5.0;
        }
        return cost;
    }

    public static void main2(String[] args) {
        int i =0;
        int j =10;
        do {
            if (i++ > --j) {
                continue;
            }
        }while (i<5);
        System.out.println("i="+ i + "j=" + j);
    }

    public static void main3(String[] args) {
        int x =10;
        int y = ++x + x++ + --x;
        System.out.println(x);
        System.out.println(y);
    }

    public static void main5(String[] args) {
        int i,j;
        int [ ]a={5,9,6,8,7};
        for ( i = 0; i < a.length -1; i++) {
            int k = i;
            for ( j = i; j < a.length ; j++) {
                if (a[j] < a[k]) {
                    k = j;
                    int temp = a[i];
                    a[i] = a[k];
                    a[k] =  temp;
                }

            }
        }
        for (i = 0; i < a.length ;i ++) {
            System.out.print(a[i] + "");
            System.out.println();
        }

    }

    public static void main6(String[] args) {
        int [] arryr = {1,2,3,4,5};
        for (int i = 0; i < arryr.length; i++) {
            if (i % 2 == 0 ) {
                arryr[i] = arryr[i] * 2;
            }
        }
        for (int value : arryr) {
            System.out.print(value + " ");
        }
    }

    public static void main(String[] args) {
        String A= "123";
        String B = "123";
        System.out.println(A == B);
        System.out.println(A.equals(B));
    }
}


